package com.ss.android.article.base.ui;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;

public final class k extends ak {
    public int a;
    public int b;

    public k(Drawable arg1) {
        super(arg1);
    }

    public k(Context arg1) {
        super(arg1);
    }

    public final void draw(Canvas arg11, CharSequence arg12, int arg13, int arg14, float arg15, int arg16, int arg17, int arg18, Paint arg19) {
        float v5 = arg15 + (((float)this.a));
        Drawable v0 = this.getDrawable();
        Paint.FontMetricsInt v1 = arg19.getFontMetricsInt();
        if(v1.bottom - v1.top < v0.getBounds().bottom) {
            super.draw(arg11, arg12, arg13, arg14, v5, arg16, arg17, arg18, arg19);
        }
        else {
            arg11.save();
            arg11.translate(v5, ((float)(v1.ascent - v1.top + (v1.descent - v1.ascent - v0.getBounds().height()) / 2 + arg16)));
            v0.draw(arg11);
            arg11.restore();
        }
    }

    public final int getSize(Paint arg4, CharSequence arg5, int arg6, int arg7, Paint.FontMetricsInt arg8) {
        Rect v0 = this.getDrawable().getBounds();
        if(arg8 != null) {
            arg8.ascent = -v0.bottom;
            arg8.descent = 0;
            arg8.top = arg8.ascent;
            arg8.bottom = 0;
        }

        return v0.right + this.a + this.b;
    }
}

